import axios from 'axios'
import { dbIp } from './config.js'
import { get_cache } from '@/util/cache.js'
var ip = dbIp

export function getUserCollectVideo (param){
    return axios({
        method: "get",
        url: ip+"/video/getUserCollectVideo",
        params: {
            ...param,
            token: get_cache("token")
        }
    });
}

export function collectVideo (param){
    return axios({
        method: "get",
        url: ip+"/video/collectVideo",
        params: {
            ...param,
            token: get_cache("token")
        }
    });
}

export function getUserDianVideo (param){
    return axios({
        method: "get",
        url: ip+"/video/getUserDianVideo",
        params: {
            ...param,
            token: get_cache("token")
        }
    });
}

export function dianVideo (param){
    return axios({
        method: "get",
        url: ip+"/video/dianVideo",
        params: {
            ...param,
            token: get_cache("token")
        }
    });
}

export function getVideo (param){
    return axios({
        method: "get",
        url: ip+"/video/getList",
        params: {
            ...param
        }
    });
}

export function getVideoById (id){
    return axios({
        method: "get",
        url: ip+"/video/getById",
        params: { id , user: get_cache("token") }
    });
}

export function checkVideo (video){
    return axios({
        method: "get",
        url: ip+"/video/checkVideo",
        params: { video , user: get_cache("token") }
    });
}
